<div class="kmi-layout-content B0502-content c-mdd-page" ng-init="init();" page-type="Page" _transclude-elem="[object Object]">
  <div class="kmi-header-row">
    <div class="brand-title">
      <div class="custom" ng-if="companyName">
        <div class="title" ng-bind="companyName"></div>
        <img src="" alt="" class="brand" />
        <div class="gap"></div>
      </div>
      <div class="digiwin">
        <img src="image/smes_v340/logo_ch.png" alt="" />
        <img src="image/smes_v340/logo_en.png" alt="" />
      </div>
    </div>
    <div class="header-title" ng-bind="_title | translate"></div>

    <div class="right">
      <button ng-hide="_fn['favorite'].isShown == 'N'" ng-click="_fn['favorite'].click('favorite');">
        <img src="image/smes_v340/W_Com_Love_nor_32.png" />
        <div class="kmi-can-click"></div>
      </button>
    </div>
  </div>
  <div class="kmi-layout-main-content">
    <div class="mdd-layout c-mdd-layout" layout-name="B0502" page-name="" page-type="Page" with-toolbar="N" reload="N" _transclude-elem="[object Object]" style="grid-template-columns: repeat(4, auto 1fr)">
      <div item-name="qc_page_type" class="select_panel" style="grid-column-start: span 8">
        <div class="qc_button tab" ng-click="switchJY('first_check')" ng-class="{'is-select':qc_page == 'first_check'}">
          <label class="title-name" ng-bind="'B0502.first_check' | translate"></label>
        </div>
        <div class="qc_button tab" ng-click="switchJY('spot_check')" ng-class="{'is-select':qc_page == 'spot_check'}">
          <label class="title-name" ng-bind="'B0502.spot_check' | translate"></label>
        </div>
        <div class="qc_button tab" ng-click="switchJY('last_check')" ng-class="{'is-select':qc_page == 'last_check'}">
          <label class="title-name" ng-bind="'B0502.last_check' | translate"></label>
        </div>
      </div>
      <label class="label" ng-show="_event['loadStationNo'].isShown != 'N'" style="" ng-bind="'B0502.columns.loadStationNo' | translate"></label>
      <div class="value" ng-show="_event['loadStationNo'].isShown != 'N'" style="grid-column-start: span 3">
        <input type="text" readonly="" ng-model="condition.op_no" ng-click="_event['loadStationNo'].click(condition.op_no, {event:$event});" ng-disabled="_event['loadStationNo'].isDisabled == 'Y'" />
        <div class="tip">
          <img src="image/icons/search.png" />
        </div>
      </div>
      <label class="label" ng-show="_event['plot_no'].isShown != 'N'" style="" ng-bind="'B0502.columns.plot_no' | translate"></label>
      <div class="value" ng-show="_event['plot_no'].isShown != 'N'" style="grid-column-start: span 3">
        <input type="text" undefined="" id="plot_no" ng-model="condition.plot_no" ng-keypress="_event['plot_no'].change(condition.plot_no, {event:$event});" ng-disabled="_event['plot_no'].isDisabled == 'Y'" />
        <div class="tip search">
          <img src="image/icons/search.png" ng-click="_event['plot_no'].click(condition.plot_no, {event:$event});" ng-disabled="_event['plot_no'].isDisabled == 'Y'" />
        </div>
      </div>
      <label class="label" ng-show="_event['inspection_info'].isShown != 'N'" style="" ng-bind="'B0502.columns.inspection_info' | translate"></label>
      <div class="value" ng-show="_event['inspection_info'].isShown != 'N'" style="">
        <input type="text" readonly="" ng-model="inspectionInfo.check_qty" ng-click="_event['inspection_info'].click(inspectionInfo.check_qty, {event:$event});" ng-disabled="_event['inspection_info'].isDisabled == 'Y'" />
      </div>
      <div item-name="employee_no" style="grid-column-start: span 2">
        <div class="kmi-text-fields">
          <label class="label" ng-bind="'B0502.employee_no' | translate" style="text-align: left"></label>
          <input class="employee_no value" ng-model="inspectionInfo.employee_no" ng-keydown="input_employee_no($event);" ng-class="[isCheck(inspectionInfo.legal_employee_no)]" ng-disabled="!inspectionInfo" />
          <div class="tip search" ng-click="check_employee_no();"><img src="image/icons/search.png" /></div>
        </div>
      </div>
      <label class="label" ng-show="_event['check_time'].isShown != 'N'" style="" ng-bind="'B0502.columns.check_time' | translate"></label>
      <div class="value" ng-show="_event['check_time'].isShown != 'N'" style=""><label class="value" ng-bind="inspectionInfo.check_time | date:'yyyy-MM-dd HH:mm:ss'" mdl-toast="{{inspectionInfo.check_time | date:'yyyy-MM-dd HH:mm:ss'}}" mdl-toast-passive="true"></label></div>
      <label class="label" ng-show="_event['area_no'].isShown != 'N'" style="" ng-bind="'B0502.columns.area_no' | translate"></label>
      <div class="value" ng-show="_event['area_no'].isShown != 'N'" style=""><label class="value" ng-bind="inspectionInfo.area_no" mdl-toast="{{inspectionInfo.area_no}}" mdl-toast-passive="true"></label></div>
      <label class="label" ng-show="_event['machine_no'].isShown != 'N'" style="" ng-bind="'B0502.columns.machine_no' | translate"></label>
      <div class="value" ng-show="_event['machine_no'].isShown != 'N'" style="">
        <input type="text" undefined="" id="machine_no" ng-model="inspectionInfo.machine_no" ng-keypress="_event['machine_no'].change(inspectionInfo.machine_no, {event:$event});" ng-disabled="_event['machine_no'].isDisabled == 'Y'" />
        <div class="tip search">
          <img src="image/icons/search.png" ng-click="_event['machine_no'].click(inspectionInfo.machine_no, {event:$event});" ng-disabled="_event['machine_no'].isDisabled == 'Y'" />
        </div>
      </div>
      <label class="label" ng-show="_event['work_machine'].isShown != 'N'" style="" ng-bind="'B0502.columns.work_machine' | translate"></label>
      <div class="value" ng-show="_event['work_machine'].isShown != 'N'" style="">
        <input type="text" undefined="" id="work_machine" ng-model="inspectionInfo.work_machine" ng-keypress="_event['work_machine'].change(inspectionInfo.work_machine, {event:$event});" ng-disabled="_event['work_machine'].isDisabled == 'Y'" />
        <div class="tip search">
          <img src="image/icons/search.png" ng-click="_event['work_machine'].click(inspectionInfo.work_machine, {event:$event});" ng-disabled="_event['work_machine'].isDisabled == 'Y'" />
        </div>
      </div>
      <label class="label" ng-show="_event['pcs_no'].isShown != 'N'" style="" ng-bind="'B0502.columns.pcs_no' | translate"></label>
      <div class="value" ng-show="_event['pcs_no'].isShown != 'N'" style="">
        <input type="text" undefined="" id="pcs_no" ng-model="inspectionInfo.pcs_no" ng-keypress="_event['pcs_no'].change(inspectionInfo.pcs_no, {event:$event});" ng-disabled="_event['pcs_no'].isDisabled == 'Y'" />
      </div>
      <div class="mdd-list c-mdd-list" null="" ng-show="_event['checkList'].isShown != 'N'" style="height:{{_event['B0502'].GetfillHeight()}};grid-column-start:span 8;" list-name="B0502_list" list-bind="checkList" list-alias="inspectionInfo.qc_reason_detail" enable-select="N" select-all="N" page-name="" page-type="Page" _transclude-elem="[object Object]">
        <div class="kmi-list column-selector" kmi-scrollbar="480px" column-selector-id="B0502_list" style="flex: 1">
          <div class="kmi-list__header">
            <div class="kmi-list__column head-controls" style="flex: 1" ng-show="_event['checkList.reason_no'].isShown != 'N'">
              <div class="filter" ng-show="_objcheckList.header[0].isFilter">
                <input ng-model="_objcheckList.filterColumns['reason_no']" />
                <i class="material-icons clear" style="position: absolute; top: 2px; right: 4px" ng-click="_objcheckList.header[0].isFilter = false;_objcheckList.filterColumns['reason_no'] = '';">clear</i>
              </div>

              <div class="order" ng-hide="_objcheckList.header[0].isFilter">
                <i class="material-icons search" style="z-index: 1" ng-click="_objcheckList.header[0].isFilter = true">search</i>
                <label ng-bind="'B0502_list.columns.reason_no' | translate"></label>
                <i class="material-icons" ng-show="_objcheckList.queryOrder == 0">{{!_objcheckList.header[0].order?'':''}}</i>
                <div class="kmi-can-click" ng-click="orderResult(0, 'reason_no', '_objcheckList');"></div>
              </div>
            </div>
            <div class="kmi-list__column head-controls" style="flex: 1" ng-show="_event['checkList.reason_name'].isShown != 'N'">
              <div class="filter" ng-show="_objcheckList.header[1].isFilter">
                <input ng-model="_objcheckList.filterColumns['reason_name']" />
                <i class="material-icons clear" style="position: absolute; top: 2px; right: 4px" ng-click="_objcheckList.header[1].isFilter = false;_objcheckList.filterColumns['reason_name'] = '';">clear</i>
              </div>

              <div class="order" ng-hide="_objcheckList.header[1].isFilter">
                <i class="material-icons search" style="z-index: 1" ng-click="_objcheckList.header[1].isFilter = true">search</i>
                <label ng-bind="'B0502_list.columns.reason_name' | translate"></label>
                <i class="material-icons" ng-show="_objcheckList.queryOrder == 1">{{!_objcheckList.header[1].order?'':''}}</i>
                <div class="kmi-can-click" ng-click="orderResult(1, 'reason_name', '_objcheckList');"></div>
              </div>
            </div>
            <div class="kmi-list__column head-controls" style="flex: 1" ng-show="_event['checkList.reason_method'].isShown != 'N'">
              <div class="filter" ng-show="_objcheckList.header[2].isFilter">
                <input ng-model="_objcheckList.filterColumns['reason_method']" />
                <i class="material-icons clear" style="position: absolute; top: 2px; right: 4px" ng-click="_objcheckList.header[2].isFilter = false;_objcheckList.filterColumns['reason_method'] = '';">clear</i>
              </div>

              <div class="order" ng-hide="_objcheckList.header[2].isFilter">
                <i class="material-icons search" style="z-index: 1" ng-click="_objcheckList.header[2].isFilter = true">search</i>
                <label ng-bind="'B0502_list.columns.reason_method' | translate"></label>
                <i class="material-icons" ng-show="_objcheckList.queryOrder == 2">{{!_objcheckList.header[2].order?'':''}}</i>
                <div class="kmi-can-click" ng-click="orderResult(2, 'reason_method', '_objcheckList');"></div>
              </div>
            </div>
            <div item-name="picture_path" class="kmi-list__column" style="flex: 0 0 68px" ng-bind="'B0207.check_list.column4' | translate"></div>
            <div class="kmi-list__column head-controls" style="flex: 1 1 0%" ng-show="_event['checkList.check_standard'].isShown != 'N'">
              <div class="filter" ng-show="_objcheckList.header[4].isFilter">
                <input ng-model="_objcheckList.filterColumns['check_standard']" />
                <i class="material-icons clear" style="position: absolute; top: 2px; right: 4px" ng-click="_objcheckList.header[4].isFilter = false;_objcheckList.filterColumns['check_standard'] = '';">clear</i>
              </div>

              <div class="order" ng-hide="_objcheckList.header[4].isFilter">
                <i class="material-icons search" style="z-index: 1" ng-click="_objcheckList.header[4].isFilter = true">search</i>
                <label ng-bind="'B0502_list.columns.check_standard' | translate"></label>
                <i class="material-icons" ng-show="_objcheckList.queryOrder == 4">{{!_objcheckList.header[4].order?'':''}}</i>
                <div class="kmi-can-click" ng-click="orderResult(4, 'check_standard', '_objcheckList');"></div>
              </div>
            </div>
            <div class="kmi-list__column head-controls" style="flex: 1 1 0%" ng-show="_event['checkList.check_result'].isShown != 'N'">
              <div class="filter" ng-show="_objcheckList.header[5].isFilter">
                <input ng-model="_objcheckList.filterColumns['check_result']" />
                <i class="material-icons clear" style="position: absolute; top: 2px; right: 4px" ng-click="_objcheckList.header[5].isFilter = false;_objcheckList.filterColumns['check_result'] = '';">clear</i>
              </div>

              <div class="order" ng-hide="_objcheckList.header[5].isFilter">
                <i class="material-icons search" style="z-index: 1" ng-click="_objcheckList.header[5].isFilter = true">search</i>
                <label ng-bind="'B0502_list.columns.check_result' | translate"></label>
                <i class="material-icons" ng-show="_objcheckList.queryOrder == 5">{{!_objcheckList.header[5].order?'':''}}</i>
                <div class="kmi-can-click" ng-click="orderResult(5, 'check_result', '_objcheckList');"></div>
              </div>
            </div>
            <div class="kmi-list__column head-controls" style="flex: 1" ng-show="_event['checkList.description'].isShown != 'N'">
              <div class="filter" ng-show="_objcheckList.header[6].isFilter">
                <input ng-model="_objcheckList.filterColumns['description']" />
                <i class="material-icons clear" style="position: absolute; top: 2px; right: 4px" ng-click="_objcheckList.header[6].isFilter = false;_objcheckList.filterColumns['description'] = '';">clear</i>
              </div>

              <div class="order" ng-hide="_objcheckList.header[6].isFilter">
                <i class="material-icons search" style="z-index: 1" ng-click="_objcheckList.header[6].isFilter = true">search</i>
                <label ng-bind="'B0502_list.columns.description' | translate"></label>
                <i class="material-icons" ng-show="_objcheckList.queryOrder == 6">{{!_objcheckList.header[6].order?'':''}}</i>
                <div class="kmi-can-click" ng-click="orderResult(6, 'description', '_objcheckList');"></div>
              </div>
            </div>
          </div>
          <div class="kmi-list__row-content">
            <div class="kmi-list__row" id="B0502_list_result_list" ng-repeat="item in _event['checkList'].getPages(inspectionInfo.qc_reason_detail, _objcheckList.PageConfig, _objcheckList.filterColumns, _objcheckList.header[_objcheckList.queryOrder]) track by $index" ng-class="{'is-select':_event['checkList'].checkSelect(item, {index:$index, event:$event})}">
              <div class="kmi-list__column column-border" style="flex: 1" ng-bind="item.reason_no" ng-if="_event['checkList.reason_no'].isShown != 'N'"></div>
              <div class="kmi-list__column column-border" style="flex: 1" ng-bind="item.reason_name" ng-if="_event['checkList.reason_name'].isShown != 'N'"></div>
              <div class="kmi-list__column column-border" style="flex: 1" ng-bind="item.reason_method" ng-if="_event['checkList.reason_method'].isShown != 'N'"></div>
              <div class="kmi-list__column column-border is-wrap" item-name="picture_path" style="flex: 0 0 68px; z-index: 1">
                <img class="pic" ng-show="item.picture_path!=''" ng-src="{{server_url+item.picture_path}}" ng-click="open_checkPic(item);" />
              </div>
              <div item-name="check_standard" class="kmi-list__column column-border is-wrap" style="flex: 1" ng-bind="item.check_type===1?(item.reason_description+('（'+item.mini_value+'~'+item.max_value+'）')):item.reason_description"></div>
              <div class="kmi-list__column column-input" item-name="check_result" style="flex: 1 1 0%; z-index: 1">
                <div ng-show="item.check_type == 0" class="check-point-switch" ng-class="{'is-selected':item.reason_value == 'true'}" ng-click="item.reason_value = item.reason_value=='true'?'false':'true'">
                  <div style="width: 26px; height: 24px"></div>
                </div>
                <input ng-show="item.check_type == 1" mdl-calculater="item.reason_value" mdl-calculater-decimal="true" ng-click="RangeValue();" />
                <img style="height: 24px; width: 24px; padding-left: 4px" ng-show="item.check_type == 1 &amp;&amp; InRange(item)" src="image/icons/check1.png" />
                <img style="height: 24px; width: 24px; padding-left: 4px" ng-show="item.check_type == 1 &amp;&amp; !InRange(item)" src="image/icons/not1.png" />
                <input ng-show="item.check_type == 2" ng-model="item.reason_value" />
              </div>
              <div class="kmi-list__column column-input" style="flex: 1; z-index: 1" ng-class="{'column-border':!$last}" ng-show="_event['checkList.description'].isShown != 'N'">
                <div class="kmi-text-fields">
                  <input type="text" undefined="" id="description" ng-model="item.description" ng-keypress="_event['checkList.description'].change(item.description, {eventScope:item, event:$event, index:$index});" />
                </div>
              </div>
              <div class="kmi-can-click" ng-click="_event['checkList'].rowClick(item, {index:$index, event:$event});"></div>
            </div>
          </div>
        </div>
        <div class="page-content">
          <div class="page-icon">
            <img src="image/icons/dropleft.png" />
            <div class="kmi-can-click" ng-click="prevPage(_objcheckList.PageConfig);"></div>
          </div>
          <label ng-bind="pageInfo(_objcheckList.PageConfig);"></label>
          <div class="page-icon">
            <img src="image/icons/dropright.png" />
            <div class="kmi-can-click" ng-click="nextPage(_objcheckList.PageConfig);"></div>
          </div>
        </div>
      </div>
      <div item-name="pic" style="height:{{_event['B0502'].GetfillHeight()}}; grid-column-start: span 4;">
        <div class="image-report" style="height: 100%">
          <div class="pic-list" ng-show="picSrcArray.length != 0">
            <div class="pic-item" ng-repeat="pic in picSrcArray track by $index">
              <div class="pic-item-title">
                <span style="color: white; margin: 0px; position: absolute; top: 10px; left: 10px">{{'#'+($index+1)}}</span>
                <button class="mdl-button mdl-button--icon pic-delete" ng-click="pic_delete($index);">
                  <img src="image/icons/close.png" />
                </button>
              </div>
              <img class="pic-img" ng-src="{{'data:image/jpeg;base64,'+pic}}" ng-click="pic_open($index)" />
            </div>
          </div>
          <img class="pic-background" src="image/icons/picture.png" ng-show="picSrcArray.length == 0" />
        </div>
      </div>
      <div class="mdd-list c-mdd-list" null="" ng-show="_event['qc_reason_detail'].isShown != 'N'" style="height:{{_event['B0502'].GetfillHeight()}};grid-column-start:span 4;" list-name="B0502_inspectionInfo_list" list-bind="qc_reason_detail" list-alias="inspectionInfo.checklist_detail" enable-select="N" select-all="N" page-name="" page-type="Page" _transclude-elem="[object Object]">
        <div class="kmi-list column-selector" kmi-scrollbar="168px" column-selector-id="B0502_inspectionInfo_list" style="flex: 1">
          <div class="kmi-list__header">
            <div class="kmi-list__column head-controls" style="flex: 1 1 0%" ng-show="_event['qc_reason_detail.InspectionReasonList'].isShown != 'N'">
              <div class="filter" ng-show="_objqc_reason_detail.header[0].isFilter">
                <input ng-model="_objqc_reason_detail.filterColumns['InspectionReasonList']" />
                <i class="material-icons clear" style="position: absolute; top: 2px; right: 4px" ng-click="_objqc_reason_detail.header[0].isFilter = false;_objqc_reason_detail.filterColumns['InspectionReasonList'] = '';">clear</i>
              </div>

              <div class="order" ng-hide="_objqc_reason_detail.header[0].isFilter">
                <i class="material-icons search" style="z-index: 1" ng-click="_objqc_reason_detail.header[0].isFilter = true">search</i>
                <label ng-bind="'B0502_inspectionInfo_list.columns.InspectionReasonList' | translate"></label>
                <i class="material-icons" ng-show="_objqc_reason_detail.queryOrder == 0">{{!_objqc_reason_detail.header[0].order?'':''}}</i>
                <div class="kmi-can-click" ng-click="orderResult(0, 'InspectionReasonList', '_objqc_reason_detail');"></div>
              </div>
            </div>
            <div class="kmi-list__column head-controls" style="flex: 1" ng-show="_event['qc_reason_detail.item_qty'].isShown != 'N'">
              <div class="filter" ng-show="_objqc_reason_detail.header[1].isFilter">
                <input ng-model="_objqc_reason_detail.filterColumns['item_qty']" />
                <i class="material-icons clear" style="position: absolute; top: 2px; right: 4px" ng-click="_objqc_reason_detail.header[1].isFilter = false;_objqc_reason_detail.filterColumns['item_qty'] = '';">clear</i>
              </div>

              <div class="order" ng-hide="_objqc_reason_detail.header[1].isFilter">
                <i class="material-icons search" style="z-index: 1" ng-click="_objqc_reason_detail.header[1].isFilter = true">search</i>
                <label ng-bind="'B0502_inspectionInfo_list.columns.item_qty' | translate"></label>
                <i class="material-icons" ng-show="_objqc_reason_detail.queryOrder == 1">{{!_objqc_reason_detail.header[1].order?'':''}}</i>
                <div class="kmi-can-click" ng-click="orderResult(1, 'item_qty', '_objqc_reason_detail');"></div>
              </div>
            </div>
            <div class="kmi-list__column width-fixed" item-name="delete_button" style="flex: 0 0 48px"></div>
          </div>
          <div class="kmi-list__row-content">
            <div class="kmi-list__row" id="B0502_inspectionInfo_list_result_list" ng-repeat="item in _event['qc_reason_detail'].getPages(inspectionInfo.checklist_detail, _objqc_reason_detail.PageConfig, _objqc_reason_detail.filterColumns, _objqc_reason_detail.header[_objqc_reason_detail.queryOrder]) track by $index" ng-class="{'is-select':_event['qc_reason_detail'].checkSelect(item, {index:$index, event:$event})}">
              <div class="kmi-list__column column-border column-input" item-name="InspectionReasonList" style="flex: 1 1 0%; z-index: 1">
                <input ng-click="loadInspectionReasonList(item);" readonly="readonly" ng-value="item.page_no +' ' + item.page_name" />
              </div>
              <div class="kmi-list__column column-input" style="flex: 1; z-index: 1" ng-class="{'column-border':!$last}" ng-show="_event['qc_reason_detail.item_qty'].isShown != 'N'">
                <div class="kmi-text-fields">
                  <input type="text" readonly="" ng-model="item.item_qty" ng-click="_event['qc_reason_detail.item_qty'].click(item.item_qty, {eventScope:item, event:$event, index:$index});" />
                </div>
              </div>
              <div class="kmi-list__column" item-name="delete_button" style="flex: 0 0 48px; z-index: 1">
                <button class="mdl-button mdl-button--icon" ng-click="removeRow($index);">
                  <img style="margin: 0px" src="image/icons/delete.png" />
                </button>
              </div>
              <div class="kmi-can-click" ng-click="_event['qc_reason_detail'].rowClick(item, {index:$index, event:$event});"></div>
            </div>
          </div>
        </div>
        <div class="page-content">
          <div class="page-icon">
            <img src="image/icons/dropleft.png" />
            <div class="kmi-can-click" ng-click="prevPage(_objqc_reason_detail.PageConfig);"></div>
          </div>
          <label ng-bind="pageInfo(_objqc_reason_detail.PageConfig);"></label>
          <div class="page-icon">
            <img src="image/icons/dropright.png" />
            <div class="kmi-can-click" ng-click="nextPage(_objqc_reason_detail.PageConfig);"></div>
          </div>
        </div>
      </div>
      <div item-name="add_pic" style="grid-column-start: span 4">
        <button class="mdl-button mdl-js-button mdl-button--icon mdl-button--icon_prime" ng-click="pic_add();">
          <img src="image/icons/add.png" />
        </button>
      </div>
      <div item-name="add_reason" style="grid-column-start: span 2">
        <button class="mdl-button mdl-js-button mdl-button--icon mdl-button--icon_prime" ng-click="addRow();">
          <img src="image/icons/add.png" />
        </button>
      </div>
    </div>

    <div class="kmi-layout-footer">
      <button class="mdl-button mdl-js-button mdl-button--fab mdl-shadow--custom mdl-button--custom1" ng-disabled="_fn['Execute'].isDisabled == 'Y'" ng-hide="_fn['Execute'].isShown == 'N'" ng-click="_fn['Execute'].click('Execute');">
        <i class="material-icons">done</i>
      </button>
    </div>
  </div>
</div>
